w.window.get_parent().remove_child(w.window);
w.parent.add_child(w.window);
- if (w.window.get_meta_window().get_workspace() !=
- global.workspace_manager.get_active_workspace())
+ if (!w.window.get_meta_window().get_workspace().active)
w.window.hide();
}
switchData.container.destroy();
duration,
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
onComplete: () => {
- if (newWs !== activeWorkspace)
+ if (!newWs.active)
this.actionMoveWorkspace(newWs);
this._finishWorkspaceSwitch(switchData);
},
if (!Main.sessionMode.hasWorkspaces)
return;
- let workspaceManager = global.workspace_manager;
- let activeWorkspace = workspaceManager.get_active_workspace();
-
- if (activeWorkspace != workspace)
+ if (!workspace.active)
workspace.activate(global.get_current_time());
}
if (!Main.sessionMode.hasWorkspaces)
return;
- let workspaceManager = global.workspace_manager;
- let activeWorkspace = workspaceManager.get_active_workspace();
-
- if (activeWorkspace != workspace) {
+ if (!workspace.active) {
// This won't have any effect for "always sticky" windows
// (like desktop windows or docks)
let area = padArea(this._actualGeometry, padding);
let slots = strategy.computeWindowSlots(layout, area);
- let workspaceManager = global.workspace_manager;
- let currentWorkspace = workspaceManager.get_active_workspace();
- let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace;
+ const isOnCurrentWorkspace =
+ this.metaWorkspace === null || this.metaWorkspace.active;
for (let i = 0; i < slots.length; i++) {
let slot = slots[i];
if (this._windows.length == 0)
return;
- let workspaceManager = global.workspace_manager;
- let activeWorkspace = workspaceManager.get_active_workspace();
- if (this.metaWorkspace != null && this.metaWorkspace != activeWorkspace)
+ if (this.metaWorkspace !== null && !this.metaWorkspace.active)
return;
// Special case maximized windows, since it doesn't make sense
this._repositionWindowsId = 0;
}
- let workspaceManager = global.workspace_manager;
- let activeWorkspace = workspaceManager.get_active_workspace();
- if (this.metaWorkspace != null && this.metaWorkspace != activeWorkspace)
+ if (this.metaWorkspace !== null && !this.metaWorkspace.active)
return;
// Special case maximized windows, since it doesn't make sense
}
zoomFromOverview() {
- let workspaceManager = global.workspace_manager;
- let currentWorkspace = workspaceManager.get_active_workspace();
-
this.leavingOverview = true;
for (let i = 0; i < this._windows.length; i++)
}
this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
- if (this.metaWorkspace != null && this.metaWorkspace != currentWorkspace)
+ if (this.metaWorkspace !== null && !this.metaWorkspace.active)
return;
// Position and scale the windows.
return;
// a click on the already current workspace should go back to the main view
- let workspaceManager = global.workspace_manager;
- let activeWorkspace = workspaceManager.get_active_workspace();
- if (this.metaWorkspace == activeWorkspace)
+ if (this.metaWorkspace.active)
Main.overview.hide();
else
this.metaWorkspace.activate(time);
this._clickAction.release();
let workspaceManager = global.workspace_manager;
- let activeWorkspace = workspaceManager.get_active_workspace();
let newWs = workspaceManager.get_workspace_by_index(endProgress);
this._scrollAdjustment.ease(endProgress, {
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
duration,
onComplete: () => {
- if (newWs !== activeWorkspace)
+ if (!newWs.active)
newWs.activate(global.get_current_time());
this._endTouchGesture();
},